package com.aiyige.page.my.dynamicmanagement.model;

import com.aiyige.base.db.table.InfoModel;
import com.aiyige.base.db.table.LearnVideoModel;
import com.aiyige.base.db.table.MajorCourseDBModel;
import com.aiyige.base.db.table.NormalVideoModel;
import com.aiyige.base.db.table.PhotoModel;
import com.aiyige.base.db.table.SpecialTopicDBModel;
import com.aiyige.base.db.table.TraingCardDBModel;
import com.aiyige.base.db.table.TraingClassDBModel;
import com.aiyige.page.publish.photo.model.PublishPhotoItem;
import com.aiyige.page.publish.util.PublishUtil;
import com.chad.library.adapter.base.entity.MultiItemEntity;

import java.util.LinkedList;
import java.util.List;

/**
 * Created by zhuyakun on 2017/11/27.
 */

public class SearchResultItem implements MultiItemEntity {
    int itemType = 0;
    List<InfoModel> infoModelList = new LinkedList<>();
    List<PhotoModel> photoModelList = new LinkedList<>();
    List<NormalVideoModel> normalVideoModelList = new LinkedList<>();
    List<SpecialTopicDBModel> specialTopicDBModelList = new LinkedList<>();

    long totalInfo;
    long totalPhoto;
    long totalNormalVideo;
    long totalSpecialTopic;

    public static final int MAX_SAMPLE_NUM = 4;

    private SearchResultItem(Builder builder) {
        setItemType(builder.itemType);
        setInfoModelList(builder.infoModelList);
        setPhotoModelList(builder.photoModelList);
        setNormalVideoModelList(builder.normalVideoModelList);
        setSpecialTopicDBModelList(builder.specialTopicDBModelList);
        setTotalInfo(builder.totalInfo);
        setTotalPhoto(builder.totalPhoto);
        setTotalNormalVideo(builder.totalNormalVideo);
        setTotalSpecialTopic(builder.totalSpecialTopic);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    @Override
    public int getItemType() {
        return itemType;
    }

    public void setItemType(int itemType) {
        this.itemType = itemType;
    }

    public List<InfoModel> getInfoModelList() {
        return infoModelList;
    }

    public void setInfoModelList(List<InfoModel> infoModelList) {
        this.infoModelList = infoModelList;
    }

    public List<PhotoModel> getPhotoModelList() {
        return photoModelList;
    }

    public void setPhotoModelList(List<PhotoModel> photoModelList) {
        this.photoModelList = photoModelList;
    }

    public List<NormalVideoModel> getNormalVideoModelList() {
        return normalVideoModelList;
    }

    public void setNormalVideoModelList(List<NormalVideoModel> normalVideoModelList) {
        this.normalVideoModelList = normalVideoModelList;
    }

    public long getTotalInfo() {
        return totalInfo;
    }

    public void setTotalInfo(long totalInfo) {
        this.totalInfo = totalInfo;
    }

    public long getTotalPhoto() {
        return totalPhoto;
    }

    public void setTotalPhoto(long totalPhoto) {
        this.totalPhoto = totalPhoto;
    }

    public long getTotalNormalVideo() {
        return totalNormalVideo;
    }

    public void setTotalNormalVideo(long totalNormalVideo) {
        this.totalNormalVideo = totalNormalVideo;
    }

    public long getTotalSpecialTopic() {
        return totalSpecialTopic;
    }

    public void setTotalSpecialTopic(long totalSpecialTopic) {
        this.totalSpecialTopic = totalSpecialTopic;
    }

    public List<SpecialTopicDBModel> getSpecialTopicDBModelList() {

        return specialTopicDBModelList;
    }

    public void setSpecialTopicDBModelList(List<SpecialTopicDBModel> specialTopicDBModelList) {
        this.specialTopicDBModelList = specialTopicDBModelList;
    }


    public static final class Builder {
        private int itemType;
        private List<InfoModel> infoModelList;
        private List<PhotoModel> photoModelList;
        private List<NormalVideoModel> normalVideoModelList;
        private List<SpecialTopicDBModel> specialTopicDBModelList;
        private long totalInfo;
        private long totalPhoto;
        private long totalNormalVideo;
        private long totalSpecialTopic;

        private Builder() {
            itemType = 0;
            infoModelList = new LinkedList<>();
            photoModelList = new LinkedList<>();
            normalVideoModelList = new LinkedList<>();
            specialTopicDBModelList = new LinkedList<>();
            totalInfo = 0;
            totalPhoto = 0;
            totalNormalVideo = 0;
            totalSpecialTopic = 0;
        }

        public Builder itemType(int val) {
            itemType = val;
            return this;
        }

        public Builder infoModelList(List<InfoModel> val) {
            infoModelList = val;
            return this;
        }

        public Builder photoModelList(List<PhotoModel> val) {
            photoModelList = val;
            return this;
        }

        public Builder normalVideoModelList(List<NormalVideoModel> val) {
            normalVideoModelList = val;
            return this;
        }

        public Builder specialTopicDBModelList(List<SpecialTopicDBModel> val) {
            specialTopicDBModelList = val;
            return this;
        }

        public Builder totalInfo(long val) {
            totalInfo = val;
            return this;
        }

        public Builder totalPhoto(long val) {
            totalPhoto = val;
            return this;
        }

        public Builder totalNormalVideo(long val) {
            totalNormalVideo = val;
            return this;
        }

        public Builder totalSpecialTopic(long val) {
            totalSpecialTopic = val;
            return this;
        }

        public SearchResultItem build() {
            return new SearchResultItem(this);
        }
    }
}
